package control;

import plantObjects.TransformingUnit;

/**
 * Event for controlling the flow
 * Comparable --> Events can be compared. Needed for EventHandler
 * @author guru
 */
public class Event implements Comparable<Event>
{
    private int time;
    private Object place;

    /**
     * Creates new Event at a given time for a certain TransformingUnit
     * @param int time
     * @param TransformingUnit obj
     */
    public Event(int time, TransformingUnit obj)
    {
        this.time = time;
        place = obj;
    }

    /**
     * @return the place
     */
    public Object getPlace() {
        return place;
    }

    /**
     * @return the time
     */
    public int getTime() {
        return time;
    }
    
    // make Events comparable for the stack
    public int compareTo(Event b)
    {
        return getTime() - b.getTime();
    }
}
